<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Myclass {
    private $ci;
    function __construct() {
        $this->ci = & get_instance();
        $this->ci->load->library('form_validation');
        $this->ci->load->helper(array('url', 'date'));
        $this->ci->load->database();
        $this->ci->load->library('session');
        //$this->ci->load->session();       
    }

    public function not_admin() {
        $session = $this->ci->session->all_userdata();
        if (!isset($session['user_level']) || $session['user_level'] != 2) {
            //$xit = " ko phai admin";
            redirect('c_homepage');
        }
    }

}